<?php /*a:2:{s:76:"D:\phpStudy\WWW\tp5\application\admin\view\admin_feedback\feedback_list.html";i:1553180482;s:58:"D:\phpStudy\WWW\tp5\application\admin\view\admin\head.html";i:1550326401;}*/ ?>
 <!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>广州商学院lms-后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" type="text/css" href="/static/lib/layui/css/layui.css" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/js/jquery.js"></script>
    <script type="text/javascript" src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">反馈管理</a>
        <a>
          <cite>反馈列表</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div style="padding: 20px;">
    <ul>
        <?php if(is_array($feedbacks) || $feedbacks instanceof \think\Collection || $feedbacks instanceof \think\Paginator): $i = 0; $__LIST__ = $feedbacks;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$feedback): $mod = ($i % 2 );++$i;?>
        <li>
            <div class="list_top">
                <?php if($feedback->user): if($feedback->user->img): ?>
                <img src="/uploads/<?php echo htmlentities((isset($feedback->user->img) && ($feedback->user->img !== '')?$feedback->user->img:"")); ?>" alt="" width="60px" height="60px">
                <?php else: ?>
                <img src="/static/img/头像默认.png" alt="" width="60px" height="60px">
                <?php endif; ?>
                <?php endif; ?>
                <div>
                    <p style="color: #599CD1"><?php echo htmlentities((isset($feedback->user->user_info->realname) && ($feedback->user->user_info->realname !== '')?$feedback->user->user_info->realname:"暂无人员信息")); ?></p>
                    <p style="color: #353535"><?php echo htmlentities($feedback->create_time); ?></p>
                </div>
            </div>
            <div>
                <?php echo $feedback['content']; ?>
            </div>
            <?php if($feedback['return']): ?>
            <div class="return" >
               已回复:
                <?php echo htmlentities($feedback['return']); ?>
            </div>
            <?php else: ?>
            <div class="huifu">
                <i class="layui-icon">&#xe611;</i>
                <span>回复</span>
            </div>
            <?php endif; ?>
            <div class="list_footer">
                <input id="return" type="text" placeholder="请填写回复信息">
                <button class="layui-btn layui-btn-sm" onclick="re(this,'<?php echo htmlentities($feedback['id']); ?>')">提交</button>
                <button class="layui-btn layui-btn-sm" id="cancel">取消</button>
            </div>
        </li>
        <?php endforeach; endif; else: echo "" ;endif; ?>
    </ul>
    <div class="page">
        <?php echo $feedbacks; ?>
    </div>
<script>
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;
        //…
    });
    $(".list_footer").children('#cancel').click(function () {
        $(this).siblings("#return").val("");
        $(this).parent().hide();
        $(this).parent().prev().fadeIn();
    });
    $(".huifu").click(function () {
        $(this).next().fadeIn();
        $(this).hide();
    });

    function re(obj, id) {
        $.post(
            "<?php echo url('feedback_return'); ?>",
            {id: id, return: $(obj).prev().val()},
            function (data) {
                if (data.statu == 200) {
                    layer.msg(data.msg);
                    location.reload()
                } else {
                    layer.msg(data.msg)
                }
            }
        )
    }
</script>
<style>
    ul {
        width: 70%;
        padding: 20px;
        border: 1px solid #EFEFEF;
        margin: auto;
        box-shadow: 2px 4px 8px #EFEFEF;
    }

    li {
        padding: 10px 0px;
        border-bottom: 1px solid #EFEFEF;
    }

    .list_top {
        display: flex;
        margin-bottom: 10px;
    }

    .list_top div {
        margin-left: 20px;
        line-height: 28px;
    }

    .huifu {
        margin-top: 8px;
        width: 100px;
    }

    .huifu i {
        font-size: 18px;
        color: #CDCDCD;
    }

    .huifu span {
        color: #CDCDCD;
        font-size: 12px
    }

    .huifu:hover span {
        color: #666;
        cursor: pointer;
    }

    .huifu:hover i {
        color: #666;
        cursor: pointer;
    }

    .list_footer {
        display: none;
        margin-top: 10px;
    }

    .list_footer input {
        height: 30px;
        width: 640px;
        border: 1px solid #EFEFEF;
        padding-left: 10px;
    }
    .return {
        background: #F2F3F4;
        margin-top: 10px;
        color: #666;
    }
    .return p{
        color: #353535;
    }
</style>
</body>
</html>